package funcionarios;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;


public class HorarioTest {
	private Horario hora;
	@Before public void SetUp() throws Exception{
		hora = new Horario("Segunda", 8, 10);
	}
	@Test public void testaGets(){
		Assert.assertEquals(8, hora.getHoraI());
		Assert.assertEquals(10, hora.getHoraF());
		Assert.assertEquals("segunda", hora.getDia());
		Assert.assertEquals("segunda - 8 ate 10", hora.toString());
		try {
			Horario hora2 = new Horario("sabado", 8, 12);
			Assert.fail();
		} catch (Exception e) {
			Assert.assertEquals("Dia invalido", e.getMessage());
		}

	}
	@Test public void testaSet() throws Exception{
		hora.setDia("Terca");
		hora.setHoraI(8);
		hora.setHoraF(12);
		Assert.assertEquals("terca - 8 ate 12", hora.toString());
	}
	
}
